import request from '/src/utils/request'

export const getCarListAPI = () => {
    return request({
        url: '/cart/index',
        method: 'GET',
        header: {
            'authorization': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.e' +
                'yJuaWNrbmFtZSI6Ium7mOiupOeUqOaItyIsImF2YXRhciI6ImFj' +
                'ZTQxMTU3NDNkNTgxYjYwYjM0ZjlhOTM0NTVlNTFjLmpwZWciLCJhd' +
                'mF0YXIyIjoiaHR0cDovL3RtcDAwMDAyLmxlYXJ2LmNvbS9hY2U0MT' +
                'E1NzQzZDU4MWI2MGIzNGY5YTkzNDU1ZTUxYy5qcGVnIiwib3Blbml' +
                'kIjoib010a281RE9QTktQLXVXRDVTZzMwdzlfTzQ3TSIsInVzZXJfaWQ' +
                'iOjUsImlhdCI6MTY5OTg3MTY4NX0.lm6kd0AhNnaXV-9SXu1xXkfTWZ0L' +
                'TSX0zGTk6am0tsc'
        }
    })
}

//更新数量
export const PutUpdateNumAPI=(data)=>{
    return request({
        url:'/cart/update',
        method:'put',
        header: {
            'authorization': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.e' +
                'yJuaWNrbmFtZSI6Ium7mOiupOeUqOaItyIsImF2YXRhciI6ImFj' +
                'ZTQxMTU3NDNkNTgxYjYwYjM0ZjlhOTM0NTVlNTFjLmpwZWciLCJhd' +
                'mF0YXIyIjoiaHR0cDovL3RtcDAwMDAyLmxlYXJ2LmNvbS9hY2U0MT' +
                'E1NzQzZDU4MWI2MGIzNGY5YTkzNDU1ZTUxYy5qcGVnIiwib3Blbml' +
                'kIjoib010a281RE9QTktQLXVXRDVTZzMwdzlfTzQ3TSIsInVzZXJfaWQ' +
                'iOjUsImlhdCI6MTY5OTg3MTY4NX0.lm6kd0AhNnaXV-9SXu1xXkfTWZ0L' +
                'TSX0zGTk6am0tsc'
        },
        data,
    })
}

export const postAddShop = (data) => {
    return request({
        url:'/cart/create',
        method:'post',
        header:{
            'Content-Type':'application/x-www-form-urlencoded',
            'authorization': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.e' +
                'yJuaWNrbmFtZSI6Ium7mOiupOeUqOaItyIsImF2YXRhciI6ImFj' +
                'ZTQxMTU3NDNkNTgxYjYwYjM0ZjlhOTM0NTVlNTFjLmpwZWciLCJhd' +
                'mF0YXIyIjoiaHR0cDovL3RtcDAwMDAyLmxlYXJ2LmNvbS9hY2U0MT' +
                'E1NzQzZDU4MWI2MGIzNGY5YTkzNDU1ZTUxYy5qcGVnIiwib3Blbml' +
                'kIjoib010a281RE9QTktQLXVXRDVTZzMwdzlfTzQ3TSIsInVzZXJfaWQ' +
                'iOjUsImlhdCI6MTY5OTg3MTY4NX0.lm6kd0AhNnaXV-9SXu1xXkfTWZ0L' +
                'TSX0zGTk6am0tsc'
        },
        data,
    })
}


export const deleteShop=(data)=>{
    return request({
        url: '/cart/delete?cart_id='+data.cart_id,
        method:'delete',
        header:{
            'Content-Type':'multipart/form-data',
            'authorization': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.e' +
                'yJuaWNrbmFtZSI6Ium7mOiupOeUqOaItyIsImF2YXRhciI6ImFj' +
                'ZTQxMTU3NDNkNTgxYjYwYjM0ZjlhOTM0NTVlNTFjLmpwZWciLCJhd' +
                'mF0YXIyIjoiaHR0cDovL3RtcDAwMDAyLmxlYXJ2LmNvbS9hY2U0MT' +
                'E1NzQzZDU4MWI2MGIzNGY5YTkzNDU1ZTUxYy5qcGVnIiwib3Blbml' +
                'kIjoib010a281RE9QTktQLXVXRDVTZzMwdzlfTzQ3TSIsInVzZXJfaWQ' +
                'iOjUsImlhdCI6MTY5OTg3MTY4NX0.lm6kd0AhNnaXV-9SXu1xXkfTWZ0L' +
                'TSX0zGTk6am0tsc'
        }
    })
}